CREATE TABLE [dbo].[Task]
(
[Oid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[DateCompleted] [datetime] NULL,
[Subject] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [nvarchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DueDate] [datetime] NULL,
[StartDate] [datetime] NULL,
[AssignedTo] [uniqueidentifier] NULL,
[Status] [int] NULL,
[PercentCompleted] [int] NULL,
[OptimisticLockField] [int] NULL,
[GCRecord] [int] NULL,
[ObjectType] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Task] ADD CONSTRAINT [PK_Task] PRIMARY KEY CLUSTERED  ([Oid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iAssignedTo_Task] ON [dbo].[Task] ([AssignedTo]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iGCRecord_Task] ON [dbo].[Task] ([GCRecord]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iObjectType_Task] ON [dbo].[Task] ([ObjectType]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Task] WITH NOCHECK ADD CONSTRAINT [FK_Task_AssignedTo] FOREIGN KEY ([AssignedTo]) REFERENCES [dbo].[Party] ([Oid]) NOT FOR REPLICATION
GO
ALTER TABLE [dbo].[Task] WITH NOCHECK ADD CONSTRAINT [FK_Task_ObjectType] FOREIGN KEY ([ObjectType]) REFERENCES [dbo].[XPObjectType] ([OID]) NOT FOR REPLICATION
GO
